package com.mysoap.medicine.service;

import com.bs.entity.User;
import com.bs.service.impl.UserServiceImpl;
import com.mysoap.medicine.bean.UserQueryRequest;
import com.mysoap.medicine.bean.UserQueryResponse;

public class TUserQuerySoap {
	private UserServiceImpl userService;
	
	
	public UserServiceImpl getUserService() {
		return userService;
	}


	public void setUserService(UserServiceImpl userService) {
		this.userService = userService;
	}


	public UserQueryResponse userQueryRequest(UserQueryRequest userQueryRequest){
		UserQueryResponse response = new UserQueryResponse();
		System.out.println("service:"+userService);
		User user =null;
		user = new User();
		System.out.println("===================="+userQueryRequest);
		System.out.println(userQueryRequest.getLoginName()+"-------------");
		user.setLoginName(userQueryRequest.getLoginName());
		user.setMedicalRecords(userQueryRequest.getMedicalRecords());
		user.setUserCreateTime(userQueryRequest.getUserCreateTime());
		user.setUserId(userQueryRequest.getUserId());
		user.setUserName(userQueryRequest.getUserName());
		user.setUserPassword(userQueryRequest.getUserPassword());
		user.setUserPrivilege(userQueryRequest.getUserPrivilege());
		System.out.println("----userQueryRequest--------------");
		User rsp = userService.getUser(user);
		System.out.println("rsp"+rsp);
		System.out.println("----service after--------------");
		if(rsp==null){
			response.setDescription("用户不存在");
			response.setResultCode(1);
		}else{
			response.setDescription("操作成功");
			response.setResultCode(0);
		}
		return response;
	}
}
